[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
class PRINTER_DEFAULTS {
public string pDatatype;
public IntPtr pDevMode;
public uint DesiredAccess;
}
Structure PRINTER_DEFAULTS
Public pDatatype As IntPtr
Public pDevMode As IntPtr
Public DesiredAccess As Integer
End Structure
None.
PRINTER_DEFAULTS should be defined as a class instead of a struct, so that OpenPrinter does not need pDefaults to be passed in as a ref argument, thus you can pass in null if you want to.